package com.lrh.just.api;

import com.lrh.just.api.request.UserNoRequest;
import com.lrh.just.api.respone.ResponeDTO;
import com.lrh.just.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**用户信息前端控制器
 * @author ling
 * @date 2022--02--10
 */
@RestController
public class JustUserApi {

    /**
     * 用户信息业务类
     */
    @Autowired
    private UserService userService;

    /**
     * 获取用户信息
     * @param req 用户id
     * @return 用户信息
     */
    @PostMapping("/just/getUser")
    public ResponeDTO getUser(@RequestBody UserNoRequest req){
        return new ResponeDTO().data(userService.getUser(req.getUserId()));
    }
}
